package com.lx.entity;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lx.annotation.Note;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页入参父类
 *
 * @author ylx
 * @date 2020-06-12
 */
@Schema(name = "分页入参")
public class PageDTO<T> extends Page<T> implements Serializable {

    @Override
    @Schema(example = "10")
    public long getSize() {
        return super.getSize();
    }

    @Override
    @Schema(example = "1")
    public long getCurrent() {
        return super.getCurrent();
    }

    @JsonIgnore
    public <E>PageResult<E> getPageResult(){
        return new PageResult<E>(this);
    }

    @Override
    @JsonIgnore
    public List<T> getRecords() {
        return super.getRecords();
    }

    @Override
    @JsonIgnore
    public long getTotal() {
        return super.getTotal();
    }

    @JsonIgnore
    public List<OrderItem> getOrders() {
        return super.orders();
    }

    @JsonIgnore
    public boolean isOptimizeCountSql() {
        return super.optimizeCountSql();
    }

    @JsonIgnore
    public boolean isSearchCount() {
        return super.searchCount();
    }

    @JsonIgnore
    public boolean isOptimizeJoinOfCountSql() {
        return super.optimizeJoinOfCountSql();
    }

    @JsonIgnore
    public Long getMaxLimit() {
        return super.maxLimit();
    }

    @JsonIgnore
    public String getCountId() {
        return super.countId();
    }

    @Override
    @JsonIgnore
    public long getPages() {
        return super.getPages();
    }
}
